﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>jQuery Localisation Reference</title>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/south-street/jquery-ui.css" rel="stylesheet">
<link type="text/css" href="../common/demo.css" rel="stylesheet">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
<script type="text/javascript" src="../common/jquery.chili-2.2.js"></script>
<script type="text/javascript" src="../common/demo.js"></script>
</head>
<body>
<h1>jQuery Localisation Reference</h1>
<p>A <a href="http://jquery.com">jQuery</a> plugin
	that automatically loads JavaScript localisation packages based on the user's
	language preference.</p>
<p>This page provides a documentation reference for working
	with the plugin <span class="version">v1.1.0</span>.
	See a <a href="localisation.html">demonstration</a> of the localisation plugin
	and download the code from there.</p>
<p style="text-align: center;"><span id="bookmark"></span></p>
<div id="tabs">
	<ul>
		<li><a href="#functions"><span>Functions</span></a></li>
		<li><a href="#settings"><span>Settings</span></a></li>
	</ul>
	<div id="functions" class="feature">
		<h2>Functionality</h2>
		<table border="0">
			<tr><th>Name</th><th>Returns</th><th>Comments</th></tr>
			<tr><td>$.localise(package, settings)</td><td>-</td>
				<td>Load in localised versions of specified JavaScript packages.<br><br>
					<code>package</code> (string or string[]) is the name(s) of the
					package(s) to load<br><br>
					<code>settings</code> (object) to provide several settings
					(see <a href="#" onclick="jumpTo('settings', 'allsettings');">settings</a>) or
					is omitted to use the default language setting and parameters<br><br>
					<pre><code class="js">$.localise('mypackage.js')
$.localise('mypackage.js', {language: 'pt-BR'})
$.localise(['mypackage.js', 'another.js'])</code></pre></td></tr>
			<tr><td>$.localise(package, language, loadBase, path, timeout, async, complete)</td><td>-</td>
				<td>Load in localised versions of specified JavaScript packages.<br><br>
					<code>package</code> (string or string[]) is the name(s) of the
					package(s) to load<br><br>
					<code>language</code>, <code>loadBase</code>, <code>path</code>,
					<code>timeout</code>, <code>async</code>, <code>complete</code> (all optional)
					see <a href="#" onclick="jumpTo('settings', 'allsettings');">settings</a><br><br>
					<pre><code class="js">$.localise('mypackage.js', 'pt-BR')
$.localise(['mypackage.js', 'another.js'], true, 1000)</code></pre><br>
					<span class="version">Since 1.0.3</span> - <code>language</code> parameter only.<br>
					<span class="version">Since 1.0.4</span> - parameters up to <code>timeout</code>.<br>
					<span class="version">Since 1.1.0</span> - <code>async</code> and
					<code>complete</code> parameters.</td></tr>
			<tr><td><a name="defaultLanguage"></a>$.localise.defaultLanguage</td><td>string</td>
				<td>The default language set in the browser.<br><br>
					<span class="version">Since 1.0.3</span> - previously it was
					<code>$.defaultLanguage</code>.</td></tr>
			<tr><td>$.localize(...)</td><td>-</td>
				<td>A localisation of the <code>$.localise</code> function!<br><br>
					<span class="version">Since 1.0.3</span>.</td></tr>
		</table>
	</div>
	<div id="settings" class="feature">
		<h2><a name="allsettings"></a>Settings</h2>
		<table border="0">
			<tr><th>Name</th><th>Values</th><th>Default</th><th>Comments</th></tr>
			<tr><td>language</td><td>string</td><td>browser setting</td>
				<td>When specified, this value is used to drive the localisation process
					rather than the <a href="#" onclick="jumpTo('functions', 'defaultLanguage');">
					default browser language</a>. It is the
					<a href="http://www.ietf.org/rfc/rfc4646.txt">RFC 4646</a> language-region
					code and should be in the format <code>aa</code> or <code>aa-AA</code>.
					For example: en = English, en-AU = Australian English.</td></tr>
			<tr><td>loadBase</td><td>boolean</td><td>false</td>
				<td>When set to <code>true</code>, the base package (<code>&lt;package name&gt;.js</code>)
					is loaded prior to any of the language override versions.</td></tr>
			<tr><td>path</td><td>string or string[2]</td><td>['', '']</td>
				<td>The path or paths to the JavaScript files. If a single string is
					provided it applies to both the base and localisations files.
					If an array of two strings is given, the first is for the base file
					and the second is for the localisations.<br><br>
					<span class="version">Since 1.0.4</span>.</td></tr>
			<tr><td>timeout</td><td>number</td><td>500</td>
				<td>The timeout period for downloading the localisation packages. 
					A value of 0 indicates no timeout.</td></tr>
			<tr><td>async</td><td>boolean</td><td>false</td>
				<td>When set to <code>true</code> the localisations are loaded asynchronously.<br><br>
					<span class="version">Since 1.1.0</span>.</td></tr>
			<tr><td>complete</td><td>function</td><td>null</td>
				<td>A callback that is triggered when the localisations have finished loading
					(it only really applies when <code>async</code> is <code>true</code>).
					The function takes one parameter, being the name of the package loaded,
					and has <code>this</code> set to the <code>window</code>.<br><br>
					<span class="version">Since 1.1.0</span>.</td></tr>
		</table>
	</div>
</div>
<p>Contact Keith Wood at kbwood{at}iinet.com.au 
	with comments or suggestions.</p>
<hr>
<p>
	<a id="valid" href="http://validator.w3.org/check">
		<img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Strict"></a>
</p>
</body>
</html>
